package com.kaifamiao.www.demo.do0826;

import java.util.ArrayList;
import java.util.List;

public class Demo06 {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer();
        sb.append("a").append("b").append("c");
        System.out.println(sb);

        Loop loop = new Loop();
        System.out.println(loop.set("a").set("b").set("c"));
    }
}
class Loop{
    List<String> list = new ArrayList<>();
    public Loop set(String str){
        list.add(str);
        return this;
    }

    @Override
    public String toString() {
        return list.toString();
    }
}